import { default as request, cloud } from '@/framework/utils/request'

// 系统管理
// 查询左侧树列表
export function getSystemInfoTreeApi(query) {
  return request({
    url: cloud.interfacePlatform + '/system/administration/getSystemInfoTree',
    method: 'get',
    params: query
  })
}
// 查询表格
export function getSystemInfoPageApi(query) {
  return request({
    url: cloud.interfacePlatform + '/system/administration/getSystemInfoPage',
    method: 'get',
    params: query
  })
}
// 新增修改项目/系统
export function addSystemInfoApi(query, isAdd) {
  return request({
    url: cloud.interfacePlatform + '/system/administration/' + (isAdd ? 'updateSystemInfo' : 'addSystemInfo'),
    method: 'post',
    data: query
  })
}

// 获取上级系统
export function getSystemInfoTreeByProjectIdApi(query) {
  return request({
    url: cloud.interfacePlatform + '/system/administration/getSystemInfoTreeByProjectId',
    method: 'get',
    params: query
  })
}

// 删除
export function deleteSystemInfoApi(query) {
  return request({
    url: cloud.interfacePlatform + '/system/administration/deleteSystemInfo',
    method: 'post',
    data: query
  })
}

// 分配用户
export function assignUserApi(query) {
  return request({
    url: cloud.interfacePlatform + '/system/administration/assignUser',
    method: 'post',
    data: query
  })
}

// 查询分配过的用户
export function getSystemUserBySystemInfoApi(query) {
  return request({
    url: cloud.interfacePlatform + '/system/administration/getSystemUserBySystemInfo',
    method: 'get',
    params: query
  })
}

// 获取可以告警的人
export function getAlarmUserListApi(query) {
  return request({
    url: cloud.interfacePlatform + '/system/administration/getSystemAllUser',
    method: 'get',
    params: query
  })
}
